<!DOCTYPE html>
<!--
Copyright (c) 2013 The Chromium Authors. All rights reserved.
Use of this source code is governed by a BSD-style license that can be
found in the LICENSE file.
-->

<link rel="import" href="/tracing/core/test_utils.html">
<link rel="import" href="/tracing/extras/chrome/gpu/state.html">
<link rel="import" href="/tracing/extras/importer/trace_event_importer.html">
<link rel="import" href="/tracing/model/model.html">

<script src="/tracing/extras/chrome/gpu/state_test_data.js"></script>

<script>
'use strict';

tr.b.unittest.testSuite(function() {
  test('basic', function() {
    const m = tr.c.TestUtils.newModelWithEvents([g_gpuStateTrace]);
    const p = Object.values(m.processes)[0];

    const instance = p.objects.getAllInstancesNamed('gpu::State')[0];
    const snapshot = instance.snapshots[0];

    assert.instanceOf(snapshot, tr.e.gpu.StateSnapshot);
    assert.typeOf(snapshot.screenshot, 'string');
    instance.wasDeleted(150);
  });
});
</script>
